/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * This Source Code Form is "Incompatible With Secondary Licenses", as
 * defined by the Mozilla Public License, v. 2.0.
 */

.read-page-flip .read-text-pages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  --slide-x: 0px;
  contain: layout;
}

.read-page-flip .read-text-page {
  box-sizing: border-box;
  position: absolute;
  width: 100%;
  height: var(--window-height);
  top: 0;
  left: var(--slide-x);
  -webkit-user-select: text;
  user-select: text;
  overflow: hidden;
  overflow-wrap: break-word;
  transition: left ease-out 0.2s;
}

.read-page-flip .read-text-page::after {
  content: " ";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}

.read-page-flip .read-text-page p:first-child {
  margin-top: 0;
}

.read-page-flip .read-text-page-prev {
  left: calc(calc(-1 * var(--window-width)) + var(--slide-x));
}

.read-page-flip .read-text-page-next {
  left: calc(var(--window-width) + var(--slide-x));
}

.read-page-flip .read-text-pages-slide .read-text-page {
  transition: none;
}

.read-page-flip .read-text-page-processing {
  transition: none;
  visibility: hidden;
  z-index: -1;
}

.read-page-flip .read-text-page-processing .read-body {
  overflow: visible;
}

.read-page-flip .read-body {
  position: absolute;
  top: var(--page-margin-y);
  bottom: calc(var(--page-margin-y) + 20px);
  left: var(--page-margin-x);
  right: var(--page-margin-x);
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  text-align: justify;
  text-justify: auto;
  z-index: 2;
}

.read-page-flip .read-body-left {
  right: calc(50% + calc(var(--page-margin-x) / 2));
}

.read-page-flip .read-body-right {
  left: calc(50% + calc(var(--page-margin-x) / 2));
}

.read-page-flip .read-body p:empty::before {
  content: " ";
}

.read-page-flip .read-body p:first-child {
  margin-top: 0;
}

.read-page-flip .read-body p.text-heading {
  font-size: 120%;
  font-weight: bold;
}

.read-page-flip .read-body p.text-heading:not(:first-child) {
  margin-top: 100vh;
}

.read-page-flip .read-meta {
  position: absolute;
  bottom: var(--page-margin-y);
  left: var(--page-margin-x);
  right: var(--page-margin-x);
  height: 12px;
  display: flex;
  color: #808080;
  font-size: 12px;
  line-height: 12px;
  z-index: 2;
}

.read-page-flip .read-title {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-page-flip .read-progress {
  flex: 0 0 auto;
  white-space: nowrap;
}

.read-page-flip .read-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: visible;
  z-index: 0;
  contain: strict;
}

.read-page-flip .read-highlight span {
  position: absolute;
}

.read-page-flip .read-text-page-buttons {
  z-index: -1;
  position: absolute;
}

.read-page-flip .read-text-page-buttons .read_page_prev,
.read-page-flip .read-text-page-buttons .read_page_next {
  position: absolute;
  top: -2px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.read-page-flip .read-index {
  top: calc(calc(var(--window-height) * -1) + var(--slide-offset));
  bottom: calc(100vh - var(--slide-offset));
}

.read-page-flip .read-index.read-sub-page-current {
  top: 0;
  bottom: 0;
}

.read-page-flip .read-index:not(.read-index-slide) {
  transition: top ease-out 0.1s, bottom ease-out 0.1s;
}

.read-page-flip.read-page-wide .read-index .header-left button {
  transform: rotate(90deg);
}

